home *** CD-ROM | disk | FTP | other *** search
/ Apple Reference & Presen…rary 5 (Internal Edition) / Apple R&P Lib Internal v5.0.iso / 6-Developer Demos / Developer Demos-Gen. / America Online Demo / Online Files / Online CCL / Online CCL.rsrc / AOcl_501_Tymnet < prev    next >
Text File  |  1989-09-25  |  8KB  |  310 lines

  1. ! -----------------------------------------------------
  2. !   TYMNET.ALCL
  3. !   By: David Steinberg
  4. !   Tymnet: 691 - 8200 (1200 baud)
  5. !           352 - 3136 (2400 baud)
  6. !
  7. !   Date: June 20, 1989
  8. !   Rev: 5.00
  9. !Changed 6/21/89 by DMC: Assume "CONNECT" means 1200 baud.
  10. !Changed 7/27/89 by DMC To give new busy message when line is busy
  11. !Changed 9/14/89 by DMC To set modem to extended command set
  12. !Changed 9/19/89 to report error codes.
  13. !----------------------------------------------------------------------
  14. !
  15. ! Connect Sequence:
  16. !
  17. -LABEL 0
  18. Revision 5
  19. DsplyMsg Initializing modem.
  20. CanBtn 25               { if cancel button - just exit }
  21. SetTries 0
  22. ChrDelay 2
  23. SerReset ~BAUD 0 8 1
  24. HSReset 0 0 17 19
  25. DsplyPic 1
  26. !
  27. !----------------------------------------------------------------------
  28. !
  29. -LABEL 1                { wake up the modem }
  30. Flush
  31. !                         
  32. MatchStr 1 2 +++        { In case we match dont wait for the full time}
  33. MatchStr 2 2 OK         
  34. MatchStr 3 2 >          { Special case for Avatex 1200 modems}
  35.  
  36. Xmit +++                { Get the modems attention}
  37. Wait 200                { Pause for 2 seconds, minimum gap required}
  38. !
  39. -Label 2
  40. MatchStr 1 3 OK
  41. MatchStr 2 33 NO        { Cant hangup}
  42. MatchStr 3 33 ERROR     { Command error}
  43. MatchStr 4 3 >          { Special case for Avatex 1200 modems}
  44. !
  45. Pause 40                { Allow modem to settle a bit.}
  46. Xmit AT Z\13
  47. !                       { jump to label #3 if we see 'OK' go by }
  48. Wait 200                { wait for 'OK' from modem - fall thru if timeout }
  49. !                        
  50. Jump 33                 { Exit stage left....modem timed out. }
  51. !
  52. !---------------------------------------------------------------------
  53. !
  54. -LABEL 3                { just saw 'OK'-Set modem to x1 }
  55. !
  56. MatchStr 1 4 OK
  57. MatchStr 2 4 ERROR        {We don't care what we get for this one}
  58. !
  59. Pause 40                { Allow modem to settle between commands.}
  60. Xmit ATE1Q0X1\13
  61. !
  62. !---------------------------------------------------------------------
  63. -LABEL 4                { Now try to dial }
  64. DsplyMsg Dialing ~FONE
  65. !
  66. !Changed 6/21/89 by DMC: Assume "CONNECT" means 1200 baud.
  67. MatchStr 1 6 CONNECT\13
  68. MatchStr 2 5 CONNECT 300
  69. MatchStr 3 6 CONNECT 1200
  70. MatchStr 4 11 CONNECT 2400    {If there using an MNP modem at dial at say 9600 and connect}
  71. MatchStr 5 11 CONNECT 4800    {at 1200/300 then there screwed for now.}
  72. MatchStr 6 11 CONNECT 9600
  73. MatchStr 5 33 NO DIAL
  74. MatchStr 6 27 NO ANSWER
  75. MatchStr 7 33 VOICE
  76. MatchStr 8 33 CARRIER
  77. MatchStr 9 26 BUSY
  78. MatchStr 10 33 ERROR
  79. !
  80. SetTries 0
  81. CanBtn 24               { if cancel button hit, hangUp then exit }
  82. Pause 30
  83. Xmit AT~MSTR D~TONE~FONE\13
  84. !                       { jump to label #13 if match }
  85. Wait 2400               { wait 30 seconds for CONNECT msg from modem }
  86. !
  87. !
  88. MatchStr 1 7 2400       {We'll couldn't match, But maybe were using an MNP modem.}
  89. MatchStr 2 8 4800       {We could encounter some confusion with number dialed here.} 
  90. MatchStr 3 9 9600       {Dont check for 300,1200 due to this confusion.}
  91. !                       {Plus MNP modems may talk at a higher baud rate then there connect at.}
  92. !
  93. Wait 30
  94. Jump 27                 { else hang up phone & exit  }
  95. !
  96. !
  97. !----------------------------------------------------------------------
  98. !
  99. -Label 5
  100. SerReset 300 0 8 1
  101. Pause 20
  102. FLUSH
  103. Jump 11
  104. !
  105. !
  106. -Label 6
  107. SerReset 1200 0 8 1
  108. Pause 20
  109. FLUSH
  110. Jump 11
  111. !
  112. !
  113. -Label 7
  114. SerReset 2400 0 8 1
  115. Pause 20
  116. FLUSH
  117. Jump 11
  118. !
  119. -Label 8
  120. SerReset 4800 0 8 1
  121. Pause 20
  122. FLUSH
  123. Jump 11
  124. !
  125. -Label 9
  126. SerReset 9600 0 8 1
  127. Pause 20
  128. FLUSH
  129. Jump 11
  130. !
  131. !
  132. !
  133. !----------------------------------------------------------------------
  134. !----------------------------------------------------------------------
  135. !
  136. -LABEL 11               { Modem just sent 'CONNECT' message }
  137. DsplyPic 2
  138. Pause 600               {Give a second for line to settle on host side }
  139. !
  140. -Label 12
  141. SetTries 0              
  142. !
  143. -LABEL 13
  144. !                         { Establishing Connection }
  145. MatchStr 1 14 LOG IN:
  146. MatchStr 2 12 IDENTIFIER  {Still looking for 'A' but were aokay.}
  147. MatchStr 3 27 ABORTED
  148. MatchStr 4 27 HOST NOT
  149. MatchStr 5 16 ERROR       { Maybe connected thru alaska-net, do it the old way.}
  150. MatchStr 6 27 BAD
  151. !
  152. Flush
  153. Xmit A
  154. Wait 900
  155. IncTries
  156. IfTries 4 27
  157. Jump 13
  158. !
  159. -Label 14
  160. MatchStr 1 15 +
  161. MatchStr 2 34 PASSWORD:    {Didnt accept our Login;Password string.}
  162. MatchStr 3 16 ERROR
  163. Xmit ~TYM1;~TYM2\13        
  164. Wait 3600
  165. Jump 27
  166. !
  167. -Label 15
  168. MatchStr 1 23 CALL CONNECTED
  169. Xmit ~TYM3\13
  170. Wait 3600
  171. Jump 27
  172. !
  173. !
  174. !
  175. -Label 16                  {Try tymnets old way of connecting.}
  176. SetTries 0              
  177. !
  178. -Label 17
  179. MatchStr 1 18 PASSWORD:
  180. MatchStr 2 27 ERROR
  181. MatchStr 3 17 LOG IN:
  182. Xmit ~TYM1\13
  183. Wait 3600
  184. IncTries
  185. IfTries 4 27
  186. Jump 17
  187. !
  188. -Label 18
  189. MatchStr 1 15 +
  190. MatchStr 2 17 LOG IN:
  191. MatchStr 3 27 ERROR
  192. MatchStr 4 18 PASSWORD:
  193. Xmit ~TYM2\13
  194. Wait 3600
  195. IncTries
  196. IfTries 4 27
  197. Jump 18
  198. !
  199. !
  200. -Label 23
  201. Exit 0
  202. !
  203. !----------------------------------------------------------------------
  204. !
  205. -Label 24               {User aborted connect sequence}
  206. Hangup
  207. Exit -111
  208. !
  209. -Label 25                {User aborted but we dont need to hang up.
  210. Exit -1
  211. !----------------------------------------------------------------------
  212. !
  213. -Label 26              {Busy phone}
  214. Talert All phone lines are currently busy. \13Please wait a few minutes and try again.\13
  215. Jump 36
  216. !
  217. !----------------------------------------------------------------------
  218. !
  219. -Label 27              {No Answer}
  220. Talert There is no answer from the access  company (Error # 3).\13Verify the access number and try again.\13
  221. Jump 36
  222. !
  223. !----------------------------------------------------------------------
  224. !
  225. -Label 28              {Noisy line}
  226. Talert There is noise on your phone line (Error # 16).\13Please try again.\13
  227. Jump 36
  228. !
  229. !----------------------------------------------------------------------
  230. !
  231. -Label 29              {acct bad}
  232. Talert Unable to verify account information (Error # 22).\13\13
  233. Jump 36
  234. !
  235. !----------------------------------------------------------------------
  236. !
  237. -Label 30              {disk problem}
  238. Talert There was an error in reading your ~APPL disk (Error # 0).Please try again.\13
  239. Jump 36
  240. !
  241. !----------------------------------------------------------------------
  242. -Label 31              {acct aleady on}
  243. Talert Please wait a few minutes and try again (Error # 23).\13\13
  244. Jump 36
  245. !
  246. !----------------------------------------------------------------------
  247. !
  248. -Label 32              {not_avail}
  249. Talert ~APPL is not available at the moment (Error # 20).\13Please wait a few minutes and try again.\13\13
  250. Jump 36
  251. !
  252. !----------------------------------------------------------------------
  253. !
  254. -Label 33              {generic}
  255. Talert Unable to initialize modem (Error # 1). Please take the following steps:\13\13 1) Turn your modem off, then back on.\13 2) Verify the access number.\13 3) Make sure that your modem and phone line are connected  correctly.\13 4) Try again.
  256. Jump 36
  257. !
  258. !----------------------------------------------------------------------
  259. !
  260. -Label 34               {db_error}
  261. Talert There is a bad ~APPL file on your disk (Error # 0).\13\13
  262. Jump 36
  263. !
  264. !----------------------------------------------------------------------
  265. !
  266. -Label 35
  267. Exit -1
  268. !
  269. !----------------------------------------------------------------------
  270. !
  271. -Label 36
  272. Alert 35 \13If the problem persists, call ~APPL customer service at ~ACUS.
  273. Exit -1
  274. !
  275. !----------------------------------------------------------------------
  276. !
  277. *-Label 0                {Hangup Sequence}\
  278. *ChrDelay 2
  279. *CanBtn 2
  280. !
  281. *MatchStr 1 1 OK         {Dont look for echo first time, it maybe}
  282. *MatchStr 2 1 NO         {a false echo. Any type of match is good}
  283. *MatchStr 3 1 >          { Special case for Avatex 1200 modems}
  284. !
  285. *Xmit +++                {Try and get the modems attention}
  286. *Wait 210
  287. !
  288. *MatchStr 1 1 OK
  289. *MatchStr 2 2 CARRIER {Any type of match is good}
  290. *MatchStr 3 1 +++
  291. *MatchStr 4 1 >          { Special case for Avatex 1200 modems}
  292. !
  293. *Xmit +++                {Double our odds}
  294. *Wait 210
  295. !
  296. *-Label 1
  297. *MatchStr 1 2 ERROR
  298. *MatchStr 2 2 OK
  299. *MatchStr 3 2 CARRIER
  300. *MatchStr 4 2 >          { Special case for Avatex 1200 modems}
  301. !
  302. *Pause 40
  303. *Xmit AT H\13
  304. *Wait 300
  305. !
  306. *-Label 2
  307. *Exit 0
  308. !
  309. ###